package com.blog.service.Impl;

import com.blog.bean.domain.ChatGpt;
import com.blog.bean.vo.ChatGptVO;
import com.blog.mapper.ChatGptMapper;
import com.blog.service.ChatGptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 任浩
 * @version 1.0
 */

@Service
public class ChatGptServiceImpl implements ChatGptService {
    @Autowired
    private ChatGptMapper chatGptMapper;


    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public void saveBatchs(List<ChatGpt> chatGpts){
        chatGptMapper.saveBatchs(chatGpts);
    }

    @Override
    public List<ChatGptVO> getGptData(Integer category) {
        List<ChatGptVO> data = chatGptMapper.getData(category);

        return data;
    }

}
